import type { FormItem, OptionItem } from '../types/index.ts'
import { isRef } from 'vue'

export const getOptions = (item: FormItem): OptionItem[] => {
  if (isRef(item.options)) {
    return item.options.value as OptionItem[]
  } else {
    return item.options ?? []
  }
}
